/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package elaborate.h2x.parser;

import elaborate.h2x.transform.service.DefaultLocatorImpl;
import elaborate.h2x.transform.service.DefaultNodeGeneratorImpl;
import elaborate.h2x.transform.service.DefaultServicesImpl;
import elaborate.h2x.transform.service.Services;

/**
 * 
 * @author lendle
 */
public class DefaultTransformingModelParserBuilderImpl implements TransformingModelParserBuilder{

    protected Services services;
    protected DefFactory defFactory;
    protected RelationFactory relationFactory;
    protected RootFactory rootFactory;
    protected AsRootSettingFactory asRootSettingFactory;

    /**
     * Get the value of rootFactory
     *
     * @return the value of rootFactory
     */
    public RootFactory getRootFactory() {
        return rootFactory;
    }

    /**
     * Set the value of rootFactory
     *
     * @param rootFactory new value of rootFactory
     */
    public void setRootFactory(RootFactory rootFactory) {
        this.rootFactory = rootFactory;
    }


    /**
     * Get the value of relationFactory
     *
     * @return the value of relationFactory
     */
    public RelationFactory getRelationFactory() {
        return relationFactory;
    }

    /**
     * Set the value of relationFactory
     *
     * @param relationFactory new value of relationFactory
     */
    public void setRelationFactory(RelationFactory relationFactory) {
        this.relationFactory = relationFactory;
    }


    /**
     * Get the value of defFactory
     *
     * @return the value of defFactory
     */
    public DefFactory getDefFactory() {
        return defFactory;
    }

    /**
     * Set the value of defFactory
     *
     * @param defFactory new value of defFactory
     */
    public void setDefFactory(DefFactory defFactory) {
        this.defFactory = defFactory;
    }


    public DefaultTransformingModelParserBuilderImpl() {
        this.services=new DefaultServicesImpl();
        this.defFactory=new DefaultDefFactoryImpl();
        this.relationFactory=new DefaultRelationFactoryImpl();
        this.rootFactory=new DefaultRootFactoryImpl();
        this.asRootSettingFactory=new DefaultAsRootSettingFactoryImpl();
        ((DefaultServicesImpl)this.services).setLocator(new DefaultLocatorImpl());
        ((DefaultServicesImpl)this.services).setNodeGenerator(new DefaultNodeGeneratorImpl());
    }

    /**
     * Get the value of services
     *
     * @return the value of services
     */
    public Services getServices() {
        return services;
    }

    /**
     * Set the value of services
     *
     * @param services new value of services
     */
    public void setServices(Services services) {
        this.services = services;
    }

    public TransformingModelParser newTransformingModelParser() {
        DefaultTransformingModelParserImpl parser=new DefaultTransformingModelParserImpl(this.services, this.defFactory, this.relationFactory, this.rootFactory, this.asRootSettingFactory);
        return parser;
    }

}
